﻿using System;
using System.Data;

namespace DreamCube.Framework.DataAccess.Basic
{
    /// <summary>
    /// 记录集
    /// </summary>
    public class DBRecordSet
    {
        #region "字段"

        private DataTable table;

        #endregion

        #region "属性"

        /// <summary>
        /// 总行数
        /// </summary>
        public Int32 RowCount
        {
            get { return this.table.Rows.Count; }
        }

        /// <summary>
        /// 总列数
        /// </summary>
        public Int32 ColumnCount
        {
            get { return this.table.Columns.Count; }
        }

        #endregion

        #region "方法"

        /// <summary>
        /// 构造方法
        /// </summary>
        /// <param name="table"></param>
        public DBRecordSet(DataTable table)
        {
            this.table = table;
        }

        /// <summary>
        /// 根据序号获取记录值
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        public DBRecord GetRecord(Int32 index)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// 保存所有记录到数据库中
        /// </summary>
        /// <param name="db"></param>
        /// <returns></returns>
        public Boolean SaveAll(Database db = null)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
